home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Herois / Codigo.Cst / 00142_VejaMais- Paginas.ls < prev    next >
Encoding:
Text File  |  1999-03-19  |  2.6 KB  |  104 lines

  1. property spr
  2. property cinza, branco, verde, anima
  3. property lastAnima
  4. property sequencia
  5.  
  6. on beginSprite me
  7.   set spr to the spriteNum of me
  8.   set the visibility of sprite spr to false
  9.   set the visibility of sprite spr+1 to false
  10.   set the visibility of sprite spr+2 to false
  11.   set the visibility of sprite spr+3 to false
  12.   set branco = 0
  13.   set verde = 0
  14.   set cinza = 0
  15.   set anima = 0
  16.   set sequencia = [1, 2, 3, 4, 3, 2]
  17. end
  18.  
  19. on clicaVerde me
  20.   if verde <> 0 then
  21.     setBranco me, verde
  22.     updateStage
  23.   end if
  24. end
  25.  
  26. on cleanSprite me
  27.   repeat with i = spr to spr + 3
  28.     puppetSprite i, false
  29.     set the visibility of sprite i to true
  30.   end repeat
  31. end
  32.  
  33. on setPaginas me, n
  34.   if n > 4 then set n = 4
  35.   if n < 0 then set n = 0
  36.   set cinza = n
  37.   if n = 0 then
  38.     set the visibility of sprite spr to false
  39.     set the visibility of sprite spr+1 to false
  40.     set the visibility of sprite spr+2 to false
  41.     set the visibility of sprite spr+3 to false
  42.   else
  43.     puppetSprite spr, true
  44.     set mem = the number of member "Veja nro.Cinza"
  45.     set the member of sprite spr to member (mem + n - 1)
  46.     set the visibility of sprite spr to true
  47.     set the visibility of sprite spr+1 to false
  48.     set the visibility of sprite spr+2 to false    
  49.     set verde = 0
  50.     set branco = 0
  51.     set anima = 0
  52.     set lastAnima = the timer
  53.   end if
  54. end
  55.  
  56. on setBranco me, n
  57.   set mem = the number of member "Veja nro.Branco"
  58.   puppetSprite spr+2, true
  59.   set the member of sprite spr+2 to member (mem + n - 1)
  60.   set the visibility of sprite spr+2 to true
  61.   
  62.   fazVejaMais n  
  63. end
  64.  
  65. on idleSprite me
  66.   if cinza > 0 and (rollOver(spr) or rollOver(56)) then
  67.     set n = (the mouseV - 406) / 13
  68.     if n < 0 then set n = 0
  69.     if n > 3 then 
  70.       set n = 3
  71.     end if
  72.     set n = n + 1
  73.     if n > cinza then set n = 0
  74.     --    put the mouseV & " # " & n
  75.   else
  76.     set n = 0
  77.   end if
  78.   if n <> verde then
  79.     set verde = n
  80.     if verde = 0 then
  81.       set the visibility of sprite spr+1 to false
  82.     else
  83.       puppetSprite spr+1,true
  84.       set mem = the number of member "Veja nro.Verde"
  85.       set the member of sprite spr+1 to member (mem + verde - 1)
  86.       set the visibility of sprite spr+1 to true
  87.     end if
  88.   end if
  89.   
  90.   -- Animacao
  91.   if cinza > 0 then
  92.     if the timer > lastAnima + 30 then
  93.       set anima = anima + 1
  94.       if anima > 6 then set anima = 1
  95.       set mem = the number of member "Veja anima"
  96.       puppetSprite spr+3, true
  97.       set the member of sprite spr +3 to member (mem + getAt(sequencia,anima) - 1)
  98.       set the visibility of sprite (spr+3) to true
  99.       global gMustUpdate
  100.       set gMustUpdate = true
  101.       set lastAnima = the timer
  102.     end if
  103.   end if
  104. end